<template>
	<view class="mine">
		<view class="header bg-yellow">
			<view v-if="userInfo.headPic" class="login">
				<image :src="userInfo.headPic" mode="widthFix"></image>
				<view class="userName">
					<view>{{userInfo.nickName}}</view>
					<view class="phone"><view>{{userInfo.phone}}</view> <view class="cu-btn bg-white sm round" @tap='modalName="Modal"'>更换手机号</view></view>
				</view>
			</view>
			<view v-else>
				<button open-type="getUserInfo" class="bg-orange" @getuserinfo="getuserinfo">
					登录
				</button>
			</view>
		</view>
		<view class="section">
			<view class="bg-white padding">
				<view class="margin-bottom">我的钱包</view>
				<view class="box">
					<view @tap='goDeposit(userInfo.balance)'>
						<view class="text-price">{{userInfo.balance}}</view>
						<view>红包</view>
					</view>
					<view @tap='goCoupon'>
						<view>{{userInfo.couponNum}}</view>
						<view>优惠券</view>
					</view>
					<view @tap='gokeaidou(userInfo.kaCoin)'>
						<view v-if="userInfo.kaCoin<100000">{{userInfo.kaCoin}}</view>
						<view v-else>{{userInfo.kaCoin/10000}}万</view>
						<view>科爱豆</view>
					</view>
					<view @click="goPrize">
						<view>{{userInfo.prizeNum?userInfo.prizeNum:0}}</view>
						<view>我的奖品</view>
					</view>
				</view>
			</view>
			<view class="bg-white margin-top padding">
				<view class="margin-bottom">我的订单</view>
				<view class="cu-list grid col-3 no-border">
					<view class="cu-item" @tap='goHotelOrder'>
						<view class="cuIcon-moneybagfill icon text-yellow">
						</view>
						<view>酒店订单</view>
					</view>
					<view class="cu-item">
						<view class="cuIcon-shopfill icon text-purple">
						</view>
						<view>商城订单</view>
					</view>
					<view class="cu-item">
						<view class="iconfont icon icon-canyin text-olive cuIcon">
						</view>
						<view>餐饮订单</view>
					</view>
				</view>
			</view>
			<view class="bg-white margin-top padding">
				<view class="margin-bottom">营销功能</view>
				<view class="cu-list grid col-4 no-border">
					<view class="cu-item" @tap='goInvite'>
						<view style="font-size:45rpx;margin-top: 25rpx;" class="cuIcon-presentfill icon text-yellow">
						</view>
						<view>邀请有礼</view>
					</view>
					<view class="cu-item">
						<view class="iconfont icon-qiandao icon text-cyan cuIcon">
						</view>
						<view>我的签到</view>
					</view>
					<view class="cu-item">
						<view style="font-size:40rpx; margin-top: 30rpx;" class="iconfont icon icon-shangcheng text-mauve cuIcon">
						</view>
						<view>科爱住商城</view>
					</view>
					<view @click="goLuckDraw" class="cu-item">
						<view style="font-size:45rpx;margin-top: 25rpx;" class="iconfont icon icon-huodong text-orange cuIcon">
						</view>
						<view class="cu-tag badge" v-if="count">
							<block>{{count}}</block>
						</view>
						<view>抽奖赢大礼</view>
					</view>
				</view>
			</view>
			<!-- <view class="margin-top cu-list menu">
				<view class="cu-item arrow">
					<view class="content">
						<text>我的酒店</text>
					</view>
				</view>
				<view class="cu-item arrow" @click="modalName='bottomModal'">
					<view class="content">
						<text>常用工具</text>
					</view>
				</view>
				<view class="cu-item arrow">
					<view class="content">
						<text>加盟合作</text>
					</view>
				</view>
			</view> -->
		</view>
		
		<view class="cu-modal bottom-modal" @tap="hideModal" :class="modalName=='bottomModal'?'show':''">
			<view class="cu-dialog">
				<view class="padding-xl bg-white">
					<view class="cu-list grid col-4 no-border">
						<view class="cu-item">
							<view style="font-size:45rpx;margin-top: 25rpx;" class="iconfont icon-huiyuan icon text-yellow">
							</view>
							<view>会员计划</view>
						</view>
						<view class="cu-item">
							<view class="iconfont icon-changyonggongju2 icon text-cyan cuIcon">
							</view>
							<view>常用工具</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="cu-modal" :class="modalName=='Modal'?'show':''">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">授权手机号</view>
				</view>
				<view class="padding-xl">
					<text class="text-sm">
						科爱住需要您的手机号进行门锁绑定，在开锁时需要使用，以及短信通知
					</text>
					<button open-type="getPhoneNumber" @getphonenumber='getphonenumber' class="bg-yellow margin-top text-white">授权</button>
				</view>
			</view>
		</view>
		<u-no-network></u-no-network>
	</view>
</template>

<script>
	import mine from './mine.js'
	export default {
		...mine
	}
</script>

<style lang="scss" scoped>
	@import './mine.scss';
</style>
